//
//  BPRefundViewController.m
//  BabyPhotograph
//
//  Created by cesh on 2017/2/14.
//  Copyright © 2017年 cesh. All rights reserved.
//

#import "BPRefundViewController.h"
#import "UITextView+Placeholder.h"
#import "BPRefundRulesViewController.h"
#import <IQKeyboardManager.h>
@interface BPRefundViewController ()

@property (weak, nonatomic) IBOutlet UIButton *submitBtn;
@property (weak, nonatomic) IBOutlet UITextView *textView;

@property (weak, nonatomic) IBOutlet UIView *refundRulesView;

@property (weak, nonatomic) IBOutlet UIView *view1;
@property (weak, nonatomic) IBOutlet UIView *view2;
@property (weak, nonatomic) IBOutlet UIView *view3;
@property (weak, nonatomic) IBOutlet UIView *view4;
@property (weak, nonatomic) IBOutlet UIView *view5;


@end

@implementation BPRefundViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"取消原因";
    _submitBtn.layer.cornerRadius = 8.0;
    _textView.layer.cornerRadius = 8.0;
    _textView.placeholder = @"请填写取消原因，以帮助我们改进服务。";
    
    UITapGestureRecognizer *tapOnRefundRules = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapOnRefundRules:)];
    [_refundRulesView addGestureRecognizer:tapOnRefundRules];
    
//    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapOnView1:)];
//    [_view1 addGestureRecognizer:tap1];
//    
//    UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapOnView2:)];
//    [_view2 addGestureRecognizer:tap2];
//    
//    UITapGestureRecognizer *tap3 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapOnView3:)];
//    [_view3 addGestureRecognizer:tap3];
//    
//    UITapGestureRecognizer *tap4 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapOnView4:)];
//    [_view4 addGestureRecognizer:tap4];
//    
//    UITapGestureRecognizer *tap5 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapOnView5:)];
//    [_view5 addGestureRecognizer:tap5];
    
}

- (IBAction)selectBtn:(UIButton *)button {
    button.selected = !button.isSelected;
}


- (void)tapOnRefundRules:(UITapGestureRecognizer *)tap {
    BPRefundRulesViewController *refundRulesVC = [[BPRefundRulesViewController alloc]init];
    [self.navigationController pushViewController:refundRulesVC animated:YES];
}

- (void)tapOnView:(UIView *)view {
    for (UIView *subview in view.subviews) {
        if ([subview isKindOfClass:[UIButton class]]) {
            UIButton *button = (UIButton *)subview;
            button.selected = !button.isSelected;
        }
    }
}

- (void)tapOnView1:(UITapGestureRecognizer *)tap {
    [self tapOnView:tap.view];
}

- (void)tapOnView2:(UITapGestureRecognizer *)tap {
    [self tapOnView:tap.view];
}

- (void)tapOnView3:(UITapGestureRecognizer *)tap {
    [self tapOnView:tap.view];
}

- (void)tapOnView4:(UITapGestureRecognizer *)tap {
    [self tapOnView:tap.view];
}

- (void)tapOnView5:(UITapGestureRecognizer *)tap {
    [self tapOnView:tap.view];
}
@end
